Conventional focus detection methods used for cameras include a contrast detection method that is used for compact cameras, video cameras, and the like, a pupil division method that is used for single-lens reflex cameras, and the like. The contrast detection method is a method in which focus detection is performed by detecting a change in the contrast of an image captured by an image sensor while driving an imaging lens. However, in the focus detection method based on contrast detection, the contrast of an image captured by the image sensor while moving the imaging lens is detected, and the focus state is detected from the amount of change in the detected contrast. Thus, the method has the disadvantage that, for example, in a state that significantly differs from the in-focus state, focus detection takes time. Furthermore, the method has the disadvantage that focus detection cannot be performed with respect to a moving object. Meanwhile, the focus detection method based on pupil division is a method in which the focus state of the imaging lens is detected by correlating two images generated by light beams penetrating different pupil areas of the imaging lens.
In recent years, even the single-lens reflex cameras have come to perform shooting of moving images, and there is a demand for improvements in the AF speed. Thus, with regard to digital cameras in which contrast AF has been conventionally used, Japanese Patent Laid-Open No. 4-267211 discloses a solid-state image capture apparatus that doubles as an image capturing element, in which pixels in which relative positions of a microlens and a photoelectric conversion unit are shifted in order to improve the AF speed are two-dimensionally arranged. When the solid-state image capture apparatus disclosed in Japanese Patent Laid-Open No. 4-267211 shoots an ordinary image, the apparatus adds pixels having different directions of relative shift of the microlens and the photoelectric conversion unit, thereby generating an image. On the other hand, when calculating the focal position of the imaging lens, the solid-state image capture apparatus performs a correlation operation using a pair of image signals generated by pixel columns having different directions of relative shift of the microlens and the photoelectric conversion unit, thereby calculating the focal position of the imaging lens. Moreover, in the case where vignetting due to the imaging lens occurs in light beams that form images during calculation of the focal position, the vignetting due to the imaging lens causes the image signals to be asymmetrical (decreases the coincidence of the images). To address this issue, Japanese Patent Laid-Open No. 5-127074 discloses a technology in which a specific image modification filter housed in an image capture apparatus is deformed in accordance with the aperture ratio, the position of the exit pupil, and the defocus amount, the image modification filter is applied to the image signals, and thereafter the focal position is calculated.
In the case where a still image is acquired using an image capturing element containing focus detection pixels as described above, pixel data corresponding to the position of the focus detection pixels will be missing. If signals obtained from the focus detection pixels are used as image signals for a still image as-is, continuity between the signals from the focus detection pixels and signals from pixels around the focus detection signals will be lost because light receiving angle characteristics of the focus detection pixels differ from the light receiving angle characteristics of ordinary image capturing pixels, and therefore a favorable image cannot be acquired. In order to solve such a problem, Japanese Patent Laid-Open No. 2007-124056 discloses a technology in which image signals corresponding to the signals from the focus detection pixels undergo, depending on the missing level, interpolation that uses image signals from pixels around the focus detection pixels or offset correction or gain correction for the missing pixel data.
However, the above-described conventional technology has the problem in that even though image correction can be performed favorably in an in-focus area, since data of pixels around the pixels to be corrected is used, image correction in a defocus state is performed using the different pixels, and therefore a favorable image cannot be generated.